package www.wen.com.common.lib.initializer

import android.content.Context
import androidx.startup.Initializer
import com.scwang.smart.refresh.footer.ClassicsFooter
import com.scwang.smart.refresh.header.ClassicsHeader
import com.scwang.smart.refresh.layout.SmartRefreshLayout
import www.wen.com.common.R

/**
 * @author WEN
 * @Description:
 * @date 2020/11/30 3:02
 */
class SmartRefreshLayoutInitializer : Initializer<Unit> {

    override fun create(context: Context) {
        SmartRefreshLayout.setDefaultRefreshHeaderCreator { _, layout ->
            layout.setEnableLoadMore(false)
            layout.setPrimaryColorsId(android.R.color.transparent, R.color.color1A1A1A)
            ClassicsHeader(context)
        }
        SmartRefreshLayout.setDefaultRefreshFooterCreator { _, _ ->
            ClassicsFooter(context).setDrawableSize(20f)
        }
    }

    override fun dependencies(): List<Class<out Initializer<*>>> = emptyList()

}

